Microprocessors II מ יקרו-מ עבדים ב' סמסטר א' תשס"ט

Size: px
Start display at page:

Download "Microprocessors II מ יקרו-מ עבדים ב' סמסטר א' תשס"ט"

Transcription

1 1 1 מ יקרו-מ עבדים ב' סמסטר א' תשס"ט המרצה: ד"ר מרטין לנד

2 1 2 מיקרו-מעבדים בתוכנית הלימודים בהדסה מ ערכות ספרתיות שיטות פורמליות ואבני היסוד של חומרה מ יקרו-מעבדי ם א' כיצד המחשב הכללי מאורגן מבוא לשפת סף מ יקרו-מעבדי ם ב' תכנות מודרנית בשפת סף הבנת הפעולות במחשב ה- מ ערכות הפעלה PC ה כללי שירותי תיווך בין חומרת המחשב והמשתמש ארכיטקטורות של מ ח שבים תקשורת ביצועים במחשבים ושיטות מודרניות בתכנון מחשבים חיבור בין מחשבים בתוכנה ובחומרה

3 1 3 סילבוס רענון קצר על 8086 תכנות שפת סף עם כלים מקצועיים (NASM/MASM) מבנה של מחשב PC מצוי (ממשקים, קלט/פלט, ציוד היקפי, אפיקי ISA ו- (AGP,USB,PCI תכנות מערכת (זיכרון, קלט/פלט, (drivers 32-bit למעבדי Intel המבנה המודרני של IA-32 והמעבד

4 1 4 ספ ר י לימוד האוניברסיטה הפתוחה, משפחת המע בדים 8086 משה קליג' ועידו שרון, המחשב האישי למשתמש המקצועי, הוצאת הוד-עמי, NASM User Manual (on course web site) Intel386 TM DX Microprocessor (on course web site) V. Carl Hamacher, Zvonko G. Vranesic, Safwat G. Zaky, Computer Organization, McGraw-Hill. Tom Shanley and Don Anderson, ISA System Architecture, Mindshare, Inc., Tom Shanley and Don Anderson, PCI System Architecture, Mindshare, Inc., 1995.

5 1 5 ציונים הציון בקורס נקבע ע"י מבחן סמסטר (80%).(20%) ותרגילים הגשת 80% מהתרגילים חובה כל אחד יגיש בנפרד ובני סוח אישי. על כל שבוע איחור, יורדו 10 נקודות מציון התרגיל, ותרגיל לא יתקבל אחרי שהפתרון ניתן בכיתה. הגשת תרגיל באיחור עקב היעדרות כלשהי מותנית בהצגת איש ורים מתאימים בפני המרצה.

6 1 6 שמיר ת ק ש ר אתר הקורס דרך מערכת מידע אישי שע ו ת קבלה: דואר אלקטרוני: יום ה' 16:00 15:00 martin@multinet.net.il תמיד ני תן לפנות אלי בדואר אלקטרוני לכלול את הביטוי Micro בנושא ההודעה

7 1 7 Coding Example dseg segment para public 'data' string1 byte "hello world",0dh,0ah,0 dseg ends cseg segment para public 'code' assume cs:cseg, ds:dseg Main proc near mov ax, seg dseg mov ds, ax lea si, string1 call pr_str call ExitPgm ret Main endp ExitPgm proc near mov ah,4ch int 21h ret ExitPgm endp pr_str proc near mov ah,02h next: lodsb cmp al,00h jz p_fin mov dl,al int 21h jmp next p_fin: ret pr_str endp cseg ends end Main

8 1 8 Review of Intel 8086 Architecture

9 Implementation General Registers AH BH CH DH BP SP SI DI AL BL CL DL AX BX CX DX ALU ALU_IN ALU ALU_OUT Status Word Decoder and Control Execution Unit (EU) Instruction Pointer and Segment Registers IP CS DS SS ES OFF SEG BASE INDEX DISP Physical Address Unit (PAU) System Bus PA Address Bus Control (MAR) Instruction Queue Decoder Data Bus Control (MDR) Bus Interface Unit (BIU) PA = 10 SEG + BASE + INDEX + DISP 20 bits 16 bits Physical Address Control Main Memory Data

10 1 10 Four Segments Registers in 8086 Code Data Stack Extra 15 0 CS DS SS ES RAM ES Remember four different segments at same time Code Segment (CS) program code Stack Segment (SS) user Data Segment (DS) program data Extra Segment (ES) extra program data SS CS DS

11 1 11 General and Status Registers AH AL AX Accumulator BH BL BX Base CH CL CX Count DH DL DX Data Stack Pointer Base Pointer Source Index Destination Index Instruction Pointer 15 0 SP BP SI DI IP Status Register 15 0

12 1 12 Default Segments Automatic Addresses Memory Access Logical Address Physical Address Instruction Fetch CS:IP CS 10h+IP Stack Operation SS:SP SS 10h+SP String Destination ES:DI ES 10h+DI String Source DS:SI DS 10h+SI Effective Address (EA) Addresses for General Data Access BP BX + SI DI + Displacement Default Physical Address = DS 10h + Effective Address If EA includes BP, Physical Address = SS 10h + EA Instruction can override DS or SS to CS, ES, SS

13 1 13 Status Registers Bit Position Name Function 0 CF Carry Flag 2 PF Parity Flag - set for even number of 1 s in low order byte 4 AF Carry on low order 4-bits of AL 6 ZF Zero Result 7 SF Sign of Result 8 TF Stops after next instruction and resets TF (for single step) 9 IF Interrupt Enable 10 DF Causes string instructions to autodecrement index register (otherwise, autoincrement) 11 OF Overflow

14 1 14 Instruction Types ALU operations Mostly 2 operand operations (changes one of the inputs) Defined for byte or word operations Some require operands to be in specific registers Transfer operations String operations Control operations Conditional and unconditional branch Loop Subroutine Stack operations Push/Pop

15 1 15 Basic Instructions MOV DEST, SRC DEST SRC LEA DEST, [EA] DEST EA PUSH SRC SP SP - 2 [SS:SP] SRC POP DEST DEST [SS:SP] SP SP + 2 LDS DEST, [EA] DEST [EA] DS [EA+2] IN ACC, PORT ACC input OUT PORT, ACC output ACC ALU_OP DEST, SRC DEST DEST OP SRC ALU_Ops: NOT, AND, OR, TEST, XOR, ADD, SUB, INC, DEC, NEG, CMP, MUL, IMUL, DIV, IDIV JMP NEAR TARGET IP TARGET JMP FAR TARGET CS:IP TARGET J(CONDITION) SHORT TARGET IP TARGET ON CONDITION JC, JNC, JZ, JNZ, JG, JLE, JGE, JL, JO, JS, JNO, JNS LOOP SHORT TARGET CX CX 1 IP TARGET IF CX 0 CALL NEAR TARGET PUSH IP IP TARGET CALL FAR TARGET PUSH CS:IP CS:IP TARGET RET POP IP RETF POP CS:IP SHR, SAR, SAL SHIFT BITS INT N PUSH FLAGS, CS:IP CS:IP [4 * N] STOSB [ES:DI] AL DI DI ± 1 LODSB AL [DS:SI] SI SI ± 1

16 1 16 The Assembly Language Programming Process 1. Top-down design 1. High level design 2. Organization into modules and functions 2. Coding the modules 1. Defining local data structures and coding 2. Writing assembly language code for each module 3. Assembly 1. Converting assembly code to machine code and resolving internal references 2. Hand assembly or by assembler (program) 4. Linking 1. Resolving external address references for jump and call instructions, and creating a program file 2. Hand linking or by linker (program) 5. Loading 1. Placing program in memory to run 2. Hand loading or by loader (program)

17 1 17 Microsoft Memory Models Tiny model All data, code, in one 64 KB segment CS = DS = ES = SS Small model One segment each for code, data, CS DS SS Medium model One segment each for code, Change value of data segment register as necessary CS SS DS 1 DS 2 DS 3 Compact model One segment each for data, Change value of code segment register as necessary DS SS CS 1 CS 2 CS 3 Large model SS DS 1 DS 2 DS 3 CS 1 CS 2 CS 3

18 1 18 Storing Variables 1 Global Accessible by all modules Any running code can read or write value Local Defined for one module Only one a module can read or write value Stored in separate sections of memory Module 3 Local Data Module 2 Local Data Module 1 Local Data Module 3 Code Module 2 Code Module 1 Code Global Data

19 1 19 Global Variables Store global in default data segment Begin at address DS:[0000] Allow 2 bytes per integer (16-bit integers) 1 or 2 bytes per character (8-bit characters) Continue in order of definition Example DS:0008 DS:0007 DS:0006 DS:0005 DS:0004 DS:0003 DS:0002 DS:0001 DS:0000 Y (high byte) Y (low byte) 'C' X (high byte) X (low byte)

20 1 20 Data Frame with BP for Local Variables Stack segment frame Segment register SS is fixed First variable stored at address SS:[BP-02] Second variable stored at address SS:[BP-04] Third variable stored at address SS:[BP-06] Continue in order of definition User starts below variable definitions Used for local by most C compilers SS:BP-1 SS:BP-2 SS:BP-3 SS:BP-4 SS:BP-5 SS:BP-6 SS:BP-7 SS:BP-8 = SS:SP X (H) X (L) 'C' Y (H) Y (L) Z (H) Z (L) Empty Part of Stack

21 1 21 () { int x = 1; long y = 2; char q = '3'; int z = 4; int a[3]; int b = 5; a[0] = 6; a[1] = 7; a[2] = 8; } MOV WORD PTR [BP-02],0001 MOV WORD PTR [BP-04],0000 MOV WORD PTR [BP-06],0002 MOV BYTE PTR [BP-07],33 MOV WORD PTR [BP-0A],0004 MOV WORD PTR [BP-12],0005 MOV WORD PTR [BP-10],0006 MOV WORD PTR [BP-0E],0007 MOV WORD PTR [BP-0C],0008 Variable Allocation x (H) 00 BP-01 x (L) 01 BP-02 y (3) 00 BP-03 y (2) 00 BP-04 y (1) 00 BP-05 y (0) 02 BP-06 q 33 BP-07 XX BP-08 z (H) 00 BP-09 z (L) 04 BP-0A a[2] (H) 00 BP-0B a[2] (L) 08 BP-0C a[1] (H) 00 BP-0D a[1] (L) 07 BP-0E a[0] (H) 00 BP-0F a[0] (L) 06 BP-10 b (H) 00 BP-11 b (L) 05 BP-12

22 1 22 for Loop Example () { int i,j; for (i = 0; i < 10; i++){ j = 2 * i; } } 0B3B:0009 MOV WORD PTR [BP-02],0000 ; i = 0 0B3B:000E CMP WORD PTR [BP-02],+0A 0B3B:0012 JGE 0021 ; break on i 10 0B3B:0014 MOV AX,[BP-02] ; AX i 0B3B:0017 SHL AX,1 ; AX 2 * AX 0B3B:0019 MOV [BP-04],AX ; j AX 0B3B:001C INC WORD PTR [BP-02] ; i++ 0B3B:001F JMP 000E ; loop 0B3B:0021

23 1 23 () { int N, M = 1; for (N = 2 ; N <= 7 ; ++N){ M = N * M; } } C Versus Assembly 0B3B:0009 MOV WORD PTR [BP-04],0001 ; M = [BP-04] 1 0B3B:000E MOV WORD PTR [BP-02],0002 ; N = [BP-02] 2 0B3B:0013 CMP WORD PTR [BP-02],+07 ; compare N with 7 0B3B:0017 JG 0027 ; break if N > 7 0B3B:0019 MOV AX,[BP-02] ; AX N 0B3B:001C IMUL WORD PTR [BP-04] ; AX AX * M 0B3B:001F MOV [BP-04],AX ; M AX 0B3B:0022 INC WORD PTR [BP-02] ; ++N 0B3B:0025 JMP 0013 ; loop 0B3B:0027 0B3B:0100 MOV CX,0007 ; counter CX 7 0B3B:0103 MOV AX,0001 ; accumulator AX 1 0B3B:0106 IMUL CX ; AX AX * CX 0B3B:0108 LOOP 0106 ; CX-- loop if CX!= 0 0B3B:010A MOV [BP-02],AX ; M AX

24 1 24 Program Modules Address Resolution module calls function and function can be coded and assembled separately Efficient control of long programs : end: function: up: MOV AX,BX ADD AX,[0012] CALL function RET POP AX MOV CX,20 MUL CX LOOP up RET Assembling.asm produces.obj Contains CALL to unresolved external reference Assembling function.asm produces function.obj Contains LOOP to resolved internal reference

25 1 25 Linking Combines Separate Object Files Creates program file (.sys,.com, or.exe) Creates Program Header (for.exe files) Puts all code and data segments into program file Orders segments in a standard way Resolve references between modules Higher Addresses Stack Segment Module 2 (Function) Data Segment Module 2 (Function) Code Segment Default (Main) Code Segment Default (Main) Data Segment Program Header

26 1 26 Directives in Assembly Language Programming Feature of Assembler programming environment Not part of machine language instruction set Not available when hand assembling Cause assembler to perform certain actions during assembly Allocate memory Translate symbolic variable names to memory locations Depends on assembler Examples: DB 02, 03, 04 ; inserts 3 data bytes between ; instructions DW VAR1 02 ; defines variable VAR1 and assigns ; VAR1 = 0002 PUSH VAR1 ; references variable VAR1 LEA BX, VAR1 ; places pointer to VAR1 (location of its ; value in memory) into BX

27 1 27 Features of Common Assembler Programs debug.exe Free included with DOS and Windows Limited directives (no line labels or ) Assembly and disassembly Complete execution environment, with register checking, tracing, and debugging MASM/TASM Commercial software (Microsoft/Borland) Powerful directives for complete programming environment (, data structures, labels, procedures, etc.) Assembly only No execution or debugging features NASM Free, open source version of MASM and TASM

28 1 28 Modular Programming (Main + Functions) Easier to read and understand code Write, debug, and change modules independently Write some modules in high level language Compiler creates object code Machine code w/o linked addresses Write critical sections in assembly language Link together at end Pass local to functions as parameters.c compile.obj link prog.exe f1.asm assemble f1.obj f2.c compile f2.obj load f_std.lib

29 1 29 C Style Assembly Code Programs built from Global Functions Local defined within scope of a function Default function is called Code within may call other functions Code within a function may call other functions Code within a function may call itself Recursion requires reentrant code Each instance of function has private data memory for local function_1 function_2 function_3

30 1 30 Store global according to int_g0 DS:0 int_g1 DS:2 int_g2 DS: Friendly Model 1 Local data frame in segment Store local at top of frame int_0 SS:BP-02 int_1 SS:BP-04 int_2 SS:BP-06 Store local below local Stack expands down (SP SP 2) Data frame boundaries SS:BP points to top of frame SS:SP points to bottom of frame Change SS only if necessary SS:BP SS:SP DS:00 CS:IP function_1 function_1 function_2 function_2 function_3 function_3 function_3 function_3 global function_3 function_2 function_1

31 Friendly Model 2 Data frame boundaries SS:BP points to top of frame SS:SP points to bottom of frame Empty : SP = BP 2 bytes per variable defined in function On function call New data frame for called function SS:BP Begins below data frame for calling function Save BP calling (to use on return to calling function) Top of new frame is bottom of old frame BP called SP calling New starts below new SP called SP calling - size of variable data SP called expands down (SP SP 2) SS:BP SS:SP SS:SP DS:00 CS:IP CS:IP function_1 function_1 function_2 function_2 function_3 function_3 function_3 function_3 global function_3 function_2 function_1

32 1 32 Keeping Track of SP and BP Called function performs: SS:BP PUSH BP Saves BP calling on of calling function MOV BP,SP BP called SP calling SUB SP, 2 bytes per defined variable SP calling - size of variable data SP called <Local operations of function> MOV SP,BP Restores SP SP calling POP BP Restores BP calling from of calling function SS:BP SS:SP SS:SP DS:00 CS:IP CS:IP function_1 function_1 function_2 function_2 function_3 function_3 function_3 function_3 global function_3 function_2 function_1

33 1 33 Memory in Time-Sequence code running SS:BP f_1 code running code running SS:BP f_2 code running f_1 code running f_2 code running code running SS:BP SS:SP SS:BP f_1 SS:SP SS:BP f_2 f_2 SS:BP f_2 SS:SP SS:SP f_1 SS:SP f_2 SS:BP f_2 f_1 SS:SP f_2 CS:IP f_1 f_2 global CS:IP f_1 f_2 global CS:IP f_1 f_2 global CS:IP f_1 f_2 global SS:SP CS:IP f_1 f_1 f_2 global CS:IP f_1 f_2 global CS:IP f_1 f_2 global calls f_1 f_1 ends calls f_2 f_2 calls f_1 f_1 ends f_2 ends

34 1 34 Format of the Most General Instruction Each field is one byte long (2 HEX digits) Each field except Opcode is optional Segment Override Opcode mod reg r/m address specifiers Disp8 low order Disp16 high order Imm8 low order Imm16 high order Disp = displacement = numerical addition to address Imm = immediate = numerical value used in ALU operation Example: ES: ADD AX, [BX+SI+1234]

35 1 35 Calling DOS System Functions Operating System calls: Write required parameters to registers AH function code code identifies particular system call Interrupt INT 21 calls DOS function handler DOS runs service function code DOS call returns to user program Check exit conditions error codes returned values

36 1 36 Basic DOS System Calls Function Code Create file 3C Open file 3D Close file 3E Read from file 3F Write to file 40 File read/write pointer 42 Terminate process 4C Get keyboard input 01 Display output 02

37 1 37 The Program Segment Prefix Offset Size Contents 0000h 2 bytes int 20h (old style program terminate command) 0005h 5 bytes FAR call to MSDOS function dispatcher (int 21h) 000Ah 4 bytes Previous termination handler interrupt vector (int 22h) 000Eh 4 bytes Previous contents of ctrl-c interrupt vector (int 23h) 0012h 4 bytes Previous critical error handler interrupt vector (int 24h) 002Ch 2 bytes Segment address of the program's environment block 0080h 1 byte Parameter length (number of chars entered after filename) Becomes Disk Transfer Area (DTA) 0081h 127 bytes Parameters command tail Command tail All characters (including spaces) after file name Example format a: /q command tail = a: /q command tail contains 6 characters Disk Transfer Area (DTA) Used by some DOS functions as default buffer Command tail must be saved before overwritten

38 1 38 Structure of a DOS.com Program Store code code Increasing Addresses data and code load module load module data and code PSP JMP NEAR DS:EA SS:SP start segment = CS:0100 File on Disk File in RAM DS = CS = SS = ES = start segment - 10 Load Module = Code, Program Data, Stack, stored on disk All addresses are relative to the fixed CS = DS = SS = ES Default IP = 0100 Load

39 1 39 Structure of a DOS.exe Program Store SS SS Increasing Addresses CS stored portion of DS header load module load module CS stored portion of DS PSP data segment SS = start segment + ISS CS = start segment + ICS start segment DS = start segment - 10 File on Disk File in RAM Load Load Module = Program data,, code stored on disk ISS = Initial Stack Segment = Offset of SS from start of load module ICS = Initial Code Segment = Offset of CS from start of load module

40 1 40.EXE Program Relocation Far Code Module 5678 bytes CS:IP=0234:5678 CS= =2545 Far Code Module Stack Stack Load Module Default Code JMP FAR [1000] Segment Default Data Segment Header File CS= IP= LOAD bytes Start= bytes Default Code Segment Default Data Segment DOS+PSP RAM In.exe file, FAR segment references are relative to the load module. Relocation: After loading the program, Relocation Items (relative FAR references) are made absolute (SEG SEG + start segment)

41 1 41.EXE Program Header Offset Contents 4D 5A h Linker's signature for a valid.exe file. 00h - 01h (The ASCII letters M and Z, for Mark Zbikowski, a designer of DOS at Microsoft) 02h - 03h (Size of file including header) % (512) 04h - 05h Int [(Size of file including header) / (512)] h - 07h Number of relocation table items following header 08h - 09h Size of header in 16 byte increments (paragraphs) 0Ah - 0Bh Minimum number of 16 byte paragraphs required by program 0Ch - 0Dh Maximum number of 16 byte paragraphs required 0Eh - 0Fh ISS Displacement of segment (in paragraphs) in load module 10h - 11h Starting SP 12h - 13h Word Checksum - negative sum of words in file ignoring overflow 14h - 15h Starting IP 16h - 17h ICS Displacement of code segment (in paragraphs) in load module 18h - 19h Displacement in bytes of first relocation item in file 1Ah - 1Bh Overlay number (0 for the resident part of the program)

42 1 42 debug.exe assemble A compare C dump D enter E fill F go G hex H input I load L move M name N output O proceed P quit Q register R search S trace T unassemble U write W [address] range address [range] address [list] range list [=address] [addresses] value1 value2 port [address] [drive] [firstsector] [number] range address [pathname] [arglist] port byte [=address] [number] [register] range list [=address] [value] [range] [address] [drive] [firstsector] [number]

Microprocessors (A) DOS Services

Microprocessors (A) DOS Services 1 Services 2 System Calls Operating System services: Disk and file system management Screen display and printing Keyboard entry Other I/O management Date and time Program run and terminate Command arguments

More information

9/25/ Software & Hardware Architecture

9/25/ Software & Hardware Architecture 8086 Software & Hardware Architecture 1 INTRODUCTION It is a multipurpose programmable clock drive register based integrated electronic device, that reads binary instructions from a storage device called

More information

Intel x86 Memory. Architecture. The x86 isn't all that complex it just doesn't make a lot of sense. Program Segments. x86 Data and Address Ranges

Intel x86 Memory. Architecture. The x86 isn't all that complex it just doesn't make a lot of sense. Program Segments. x86 Data and Address Ranges 1 2 Intel x86 Memory The x86 isn't all that complex it just doesn't make a lot of sense. Architecture Mike Johnson, Leader of 80x86 Design at AMD, Microprocessor Report (1994) 3 4 Program Segments x86

More information

Ex: Write a piece of code that transfers a block of 256 bytes stored at locations starting at 34000H to locations starting at 36000H. Ans.

Ex: Write a piece of code that transfers a block of 256 bytes stored at locations starting at 34000H to locations starting at 36000H. Ans. INSTRUCTOR: ABDULMUTTALIB A H ALDOURI Conditional Jump Cond Unsigned Signed = JE : Jump Equal JE : Jump Equal ZF = 1 JZ : Jump Zero JZ : Jump Zero ZF = 1 JNZ : Jump Not Zero JNZ : Jump Not Zero ZF = 0

More information

Code segment Stack segment

Code segment Stack segment Registers Most of the registers contain data/instruction offsets within 64 KB memory segment. There are four different 64 KB segments for instructions, stack, data and extra data. To specify where in 1

More information

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad Introduction to MS-DOS Debugger DEBUG In this laboratory, we will use DEBUG program and learn how to: 1. Examine and modify the contents of the 8086 s internal registers, and dedicated parts of the memory

More information

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY BACKGROUND 8086 CPU has 8 general purpose registers listed below: AX - the accumulator register (divided into AH / AL): 1. Generates shortest machine code 2. Arithmetic, logic and data transfer 3. One

More information

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013)

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013) SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013) UNIT I THE 8086 MICROPROCESSOR PART A (2 MARKS) 1. What are the functional

More information

Intel 8086: Instruction Set

Intel 8086: Instruction Set IUST-EE (Chapter 6) Intel 8086: Instruction Set 1 Outline Instruction Set Data Transfer Instructions Arithmetic Instructions Bit Manipulation Instructions String Instructions Unconditional Transfer Instruction

More information

Intel 8086 MICROPROCESSOR ARCHITECTURE

Intel 8086 MICROPROCESSOR ARCHITECTURE Intel 8086 MICROPROCESSOR ARCHITECTURE 1 Features It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 2 20 memory locations (1 MB). It can support up to 64K I/O ports. It provides 14, 16

More information

Intel 8086 MICROPROCESSOR. By Y V S Murthy

Intel 8086 MICROPROCESSOR. By Y V S Murthy Intel 8086 MICROPROCESSOR By Y V S Murthy 1 Features It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 2 20 memory locations (1 MB). It can support up to 64K I/O ports. It provides 14,

More information

ADVANCE MICROPROCESSOR & INTERFACING

ADVANCE MICROPROCESSOR & INTERFACING VENUS INTERNATIONAL COLLEGE OF TECHNOLOGY Gandhinagar Department of Computer Enggineering ADVANCE MICROPROCESSOR & INTERFACING Name : Enroll no. : Class Year : 2014-15 : 5 th SEM C.E. VENUS INTERNATIONAL

More information

EEM336 Microprocessors I. Data Movement Instructions

EEM336 Microprocessors I. Data Movement Instructions EEM336 Microprocessors I Data Movement Instructions Introduction This chapter concentrates on common data movement instructions. 2 Chapter Objectives Upon completion of this chapter, you will be able to:

More information

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN ROAD MAP SDK-86 Intel 8086 Features 8086 Block Diagram 8086 Architecture Bus Interface Unit Execution Unit 8086 Architecture 8086 Programmer s Model Flag Register

More information

Summer 2003 Lecture 4 06/14/03

Summer 2003 Lecture 4 06/14/03 Summer 2003 Lecture 4 06/14/03 LDS/LES/LSS General forms: lds reg,mem lseg reg,mem Load far pointer ~~ outside of current segment {E.g., load reg w/value @ mem, & seg w/mem+2 XCHG Exchange values General

More information

Assembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language

Assembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language 4345 Assembly Language Assembly Language Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology Assembly Language 3-1 Overview of Assembly Language Advantages: Faster as compared

More information

PESIT Bangalore South Campus

PESIT Bangalore South Campus INTERNAL ASSESSMENT TEST 2 Date : 02/04/2018 Max Marks: 40 Subject & Code : Microprocessor (15CS44) Section : IV A and B Name of faculty: Deepti.C Time : 8:30 am-10:00 am Note: Note: Answer any five complete

More information

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM EXPERIMENT WRITE UP AIM: Assembly language program for 16 bit BCD addition LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM TOOLS/SOFTWARE

More information

Basic Assembly SYSC-3006

Basic Assembly SYSC-3006 Basic Assembly Program Development Problem: convert ideas into executing program (binary image in memory) Program Development Process: tools to provide people-friendly way to do it. Tool chain: 1. Programming

More information

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI Note: PUSHF / POPF have no operands The figure below shows that if (SS) = 3000H, (SP) = 0042H, so the execution of POP CX loads CX by the word 4050H form the stack segment. The SP is incremented by 2.

More information

8086 INSTRUCTION SET

8086 INSTRUCTION SET 8086 INSTRUCTION SET Complete 8086 instruction set Quick reference: AAA AAD AAM AAS ADC ADD AND CALL CBW CLC CLD CLI CMC CMP CMPSB CMPSW CWD DAA DAS DEC DIV HLT IDIV IMUL IN INC INT INTO I JA JAE JB JBE

More information

icroprocessor istory of Microprocessor ntel 8086:

icroprocessor istory of Microprocessor ntel 8086: Microprocessor A microprocessor is an electronic device which computes on the given input similar to CPU of a computer. It is made by fabricating millions (or billions) of transistors on a single chip.

More information

EC 333 Microprocessor and Interfacing Techniques (3+1)

EC 333 Microprocessor and Interfacing Techniques (3+1) EC 333 Microprocessor and Interfacing Techniques (3+1) Lecture 6 8086/88 Microprocessor Programming (Arithmetic Instructions) Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC

More information

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil Microprocessor By Mrs. R.P.Chaudhari Mrs.P.S.Patil Chapter 1 Basics of Microprocessor CO-Draw Architecture Of 8085 Salient Features of 8085 It is a 8 bit microprocessor. It is manufactured with N-MOS technology.

More information

CS401 Assembly Language Solved MCQS From Midterm Papers

CS401 Assembly Language Solved MCQS From Midterm Papers CS401 Assembly Language Solved MCQS From Midterm Papers May 14,2011 MC100401285 Moaaz.pk@gmail.com MC100401285@gmail.com PSMD01(IEMS) Question No:1 ( Marks: 1 ) - Please choose one The first instruction

More information

X86 Addressing Modes Chapter 3" Review: Instructions to Recognize"

X86 Addressing Modes Chapter 3 Review: Instructions to Recognize X86 Addressing Modes Chapter 3" Review: Instructions to Recognize" 1 Arithmetic Instructions (1)! Two Operand Instructions" ADD Dest, Src Dest = Dest + Src SUB Dest, Src Dest = Dest - Src MUL Dest, Src

More information

CC411: Introduction To Microprocessors

CC411: Introduction To Microprocessors CC411: Introduction To Microprocessors OBJECTIVES this chapter enables the student to: Describe the Intel family of microprocessors from 8085 to Pentium. In terms of bus size, physical memory & special

More information

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY BACKGROUND Segment The "SEGMENT" and "ENDS" directives indicate to the assembler the beginning and ending of a segment and have the following format label SEGMENT [options] ;place the statements belonging

More information

Week /8086 Microprocessor Programming

Week /8086 Microprocessor Programming Week 5 8088/8086 Microprocessor Programming Multiplication and Division Multiplication Multiplicant Operand Result (MUL or IMUL) (Multiplier) Byte * Byte AL Register or memory Word * Word AX Register or

More information

Lecture (08) x86 programming 7

Lecture (08) x86 programming 7 Lecture (08) x86 programming 7 By: Dr. Ahmed ElShafee 1 Conditional jump: Conditional jumps are executed only if the specified conditions are true. Usually the condition specified by a conditional jump

More information

Question Bank Part-A UNIT I- THE 8086 MICROPROCESSOR 1. What is microprocessor? A microprocessor is a multipurpose, programmable, clock-driven, register-based electronic device that reads binary information

More information

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM EXPERIMENT WRITE UP AIM: Assembly language program to search a number in given array. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

More information

LABORATORY WORK NO. 7 FLOW CONTROL INSTRUCTIONS

LABORATORY WORK NO. 7 FLOW CONTROL INSTRUCTIONS LABORATORY WORK NO. 7 FLOW CONTROL INSTRUCTIONS 1. Object of laboratory The x86 microprocessor family has a large variety of instructions that allow instruction flow control. We have 4 categories: jump,

More information

8086 INTERNAL ARCHITECTURE

8086 INTERNAL ARCHITECTURE 8086 INTERNAL ARCHITECTURE Segment 2 Intel 8086 Microprocessor The 8086 CPU is divided into two independent functional parts: a) The Bus interface unit (BIU) b) Execution Unit (EU) Dividing the work between

More information

CS-202 Microprocessor and Assembly Language

CS-202 Microprocessor and Assembly Language CS-202 Microprocessor and Assembly Language Lecture 2 Introduction to 8086 Assembly Language Dr Hashim Ali Spring - 2019 Department of Computer Science and Engineering HITEC University Taxila!1 Lecture

More information

Module 3 Instruction Set Architecture (ISA)

Module 3 Instruction Set Architecture (ISA) Module 3 Instruction Set Architecture (ISA) I S A L E V E L E L E M E N T S O F I N S T R U C T I O N S I N S T R U C T I O N S T Y P E S N U M B E R O F A D D R E S S E S R E G I S T E R S T Y P E S O

More information

EC-333 Microprocessor and Interfacing Techniques

EC-333 Microprocessor and Interfacing Techniques EC-333 Microprocessor and Interfacing Techniques Lecture 4 Addressing Modes Dr Hashim Ali Spring - 2018 Department of Computer Science and Engineering HITEC University Taxila Slides taken from Computer

More information

x86 Assembly Tutorial COS 318: Fall 2017

x86 Assembly Tutorial COS 318: Fall 2017 x86 Assembly Tutorial COS 318: Fall 2017 Project 1 Schedule Design Review: Monday 9/25 Sign up for 10-min slot from 3:00pm to 7:00pm Complete set up and answer posted questions (Official) Precept: Monday

More information

if 2 16bit operands multiplied the result will be

if 2 16bit operands multiplied the result will be how many operands in ADC? ans:3 how 32 bit word is defined? ans define double if 2 16bit operands multiplied the result will be ans 32bit if div by ero occurs then?? ans div by zero int for software int

More information

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات 1) Input/output In computing, input/output or I/O, is the communication between an information processing system (such as a computer) and the outside world, possibly a human or another information processing

More information

Microprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)

Microprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017) Microprocessor and Assembly Language Week-5 System Programming, BCS 6th, IBMS (2017) High Speed Memory Registers CPU store data temporarily in these location CPU process, store and transfer data from one

More information

ORG ; TWO. Assembly Language Programming

ORG ; TWO. Assembly Language Programming Dec 2 Hex 2 Bin 00000010 ORG ; TWO Assembly Language Programming OBJECTIVES this chapter enables the student to: Explain the difference between Assembly language instructions and pseudo-instructions. Identify

More information

CSC 2400: Computer Systems. Towards the Hardware: Machine-Level Representation of Programs

CSC 2400: Computer Systems. Towards the Hardware: Machine-Level Representation of Programs CSC 2400: Computer Systems Towards the Hardware: Machine-Level Representation of Programs Towards the Hardware High-level language (Java) High-level language (C) assembly language machine language (IA-32)

More information

Chapter Four Instructions Set

Chapter Four Instructions Set Chapter Four Instructions set Instructions set 8086 has 117 instructions, these instructions divided into 6 groups: 1. Data transfer instructions 2. Arithmetic instructions 3. Logic instructions 4. Shift

More information

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers. Lecture 5: Computer Organization Instruction Execution Computer Organization Addressing Buses Fetch-Execute Cycle Computer Organization CPU Control Unit U Input Output Memory Components Control Unit fetches

More information

CSC 8400: Computer Systems. Machine-Level Representation of Programs

CSC 8400: Computer Systems. Machine-Level Representation of Programs CSC 8400: Computer Systems Machine-Level Representation of Programs Towards the Hardware High-level language (Java) High-level language (C) assembly language machine language (IA-32) 1 Compilation Stages

More information

CS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers. MC

CS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers. MC CS401 Assembly Language Solved Subjective MAY 03,2012 From Midterm Papers MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 MIDTERM FALL 2011 CS401 Assembly Language Q: Affected flag of AND operation

More information

Objectives. ICT106 Fundamentals of Computer Systems Topic 8. Procedures, Calling and Exit conventions, Run-time Stack Ref: Irvine, Ch 5 & 8

Objectives. ICT106 Fundamentals of Computer Systems Topic 8. Procedures, Calling and Exit conventions, Run-time Stack Ref: Irvine, Ch 5 & 8 Objectives ICT106 Fundamentals of Computer Systems Topic 8 Procedures, Calling and Exit conventions, Run-time Stack Ref: Irvine, Ch 5 & 8 To understand how HLL procedures/functions are actually implemented

More information

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy Digital Logic Design Ch1-1 8086 Microprocessor Features: The 8086 microprocessor is a 16 bit microprocessor. The term 16 bit means

More information

Week /8086 Microprocessor Programming I

Week /8086 Microprocessor Programming I Week 4 8088/8086 Microprocessor Programming I Example. The PC Typewriter Write an 80x86 program to input keystrokes from the PC s keyboard and display the characters on the system monitor. Pressing any

More information

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit 1 1. introduction The internal function of 8086 processor are partitioned logically into processing units,bus Interface Unit(BIU)

More information

Section 001. Read this before starting!

Section 001. Read this before starting! Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 3 for Fall Semester,

More information

Week /8086 Microprocessor Programming II

Week /8086 Microprocessor Programming II Week 5 8088/8086 Microprocessor Programming II Quick Review Shift & Rotate C Target register or memory SHL/SAL 0 C SHR 0 SAR C Sign Bit 2 Examples Examples Ex. Ex. Ex. SHL dest, 1; SHL dest,cl; SHL dest,

More information

UNIT 2 PROCESSORS ORGANIZATION CONT.

UNIT 2 PROCESSORS ORGANIZATION CONT. UNIT 2 PROCESSORS ORGANIZATION CONT. Types of Operand Addresses Numbers Integer/floating point Characters ASCII etc. Logical Data Bits or flags x86 Data Types Operands in 8 bit -Byte 16 bit- word 32 bit-

More information

b) List the 16 Bit register pairs of 8085?(Any 2 pair, 1 Mark each) 2M Ans: The valid 16 bit register pair of 8085 are

b) List the 16 Bit register pairs of 8085?(Any 2 pair, 1 Mark each) 2M Ans: The valid 16 bit register pair of 8085 are Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate

More information

US06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 1: Assembly Language Terms & Directives

US06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 1: Assembly Language Terms & Directives Introduction: US06CCSC04: Introduction to Microprocessors and A microprocessor is the chip containing some control and logic circuits that is capable of a making arithmetic and logical decision based on

More information

Introduction to Microprocessor

Introduction to Microprocessor Introduction to Microprocessor The microprocessor is a general purpose programmable logic device. It is the brain of the computer and it performs all the computational tasks, calculations data processing

More information

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. 2 Microprocessor Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. It is used as CPU (Central Processing Unit) in computers. 3 Microprocessor

More information

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. 8086 Microprocessor Microprocessor Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. It is used as CPU (Central Processing Unit) in computers.

More information

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313) Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 02/06/2018 Section 1 Weighting 40% of

More information

UNIT 4. Modular Programming

UNIT 4. Modular Programming 1 UNIT 4. Modular Programming Program is composed from several smaller modules. Modules could be developed by separate teams concurrently. The modules are only assembled producing.obj modules (Object modules).

More information

Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H.

Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H. Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H. MOV AX, 5000H MOV DS, AX MOV AL, 20H MOV CL, 30H ADD AL, CL MOV CL, 10H MUL CL

More information

WINTER 12 EXAMINATION Subject Code : Model Answer Page No : / N. a) Describe the function of SID and SOD pins of 8085 microprocessor

WINTER 12 EXAMINATION Subject Code : Model Answer Page No : / N. a) Describe the function of SID and SOD pins of 8085 microprocessor Subject Code : Model Answer Page No : / N Q.1) SOLVE ANY FIVE : (20 MARKS) a) Describe the function of SID and SOD pins of 8085 microprocessor Ans: - SID: - (2 Mark) Serial Input Data SID pin is used to

More information

SHEET-2 ANSWERS. [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte.

SHEET-2 ANSWERS. [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte. SHEET-2 ANSWERS [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte. TITLE PROG2-3 PURPOSE: TRANSFER 6 WORDS OF DATA PAGE 60,132.MODEL SMALL.STACK 64.DATA ORG 10H DATA_IN DW 234DH,

More information

Introduction to IA-32. Jo, Heeseung

Introduction to IA-32. Jo, Heeseung Introduction to IA-32 Jo, Heeseung IA-32 Processors Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer

More information

Signed number Arithmetic. Negative number is represented as

Signed number Arithmetic. Negative number is represented as Signed number Arithmetic Signed and Unsigned Numbers An 8 bit number system can be used to create 256 combinations (from 0 to 255), and the first 128 combinations (0 to 127) represent positive numbers

More information

INTRODUCTION TO IA-32. Jo, Heeseung

INTRODUCTION TO IA-32. Jo, Heeseung INTRODUCTION TO IA-32 Jo, Heeseung IA-32 PROCESSORS Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer

More information

Assembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:

Assembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler: Assembling, Linking and Executing 1) Assembling: - Assembling converts source program into object program if syntactically correct and generates an intermediate.obj file or module. - It calculates the

More information

EC 333 Microprocessor and Interfacing Techniques (3+1)

EC 333 Microprocessor and Interfacing Techniques (3+1) EC 333 Microprocessor and Interfacing Techniques (3+1) Lecture 7 8086/88 Microprocessor Programming (Data Movement Instructions) Dr Hashim Ali Spring 2018 Department of Computer Science and Engineering

More information

ECpE 185 Laboratory Hand Assembly Fall 2006

ECpE 185 Laboratory Hand Assembly Fall 2006 ECpE 185 Laboratory Hand Assembly Fall 2006 Hand-Assembly, Using DEBUG Introduction: In this Hand-Assembly Lab, you will develop an 8-bit version of the program from Debug Introduction Lab, using byte-size

More information

Programming in Module. Near Call

Programming in Module. Near Call Programming in Module Main: sub1: call sub1 sub ax,ax sub1 sub1 proc near sub ax,ax endp sub1 sub1 proc Far sub ax,ax endp Near Call sub1 sub1 Main: call sub1 sub1: sub ax,ax proc near sub ax,ax endp SP

More information

Arithmetic and Logic Instructions And Programs

Arithmetic and Logic Instructions And Programs Dec Hex Bin 3 3 00000011 ORG ; FOUR Arithmetic and Logic Instructions And Programs OBJECTIVES this chapter enables the student to: Demonstrate how 8-bit and 16-bit unsigned numbers are added in the x86.

More information

Selection and Iteration. Chapter 7 S. Dandamudi

Selection and Iteration. Chapter 7 S. Dandamudi Selection and Iteration Chapter 7 S. Dandamudi Outline Unconditional jump Compare instruction Conditional jumps Single flags Unsigned comparisons Signed comparisons Loop instructions Implementing high-level

More information

APPENDIX C INSTRUCTION SET DESCRIPTIONS

APPENDIX C INSTRUCTION SET DESCRIPTIONS APPENDIX C INSTRUCTION SET DESCRIPTIONS This appendix provides reference information for the 80C186 Modular Core family instruction set. Tables C-1 through C-3 define the variables used in Table C-4, which

More information

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86 Lecture 15 Intel Manual, Vol. 1, Chapter 3 Hampden-Sydney College Fri, Mar 6, 2009 Outline 1 2 Overview See the reference IA-32 Intel Software Developer s Manual Volume 1: Basic, Chapter 3. Instructions

More information

Section 001 & 002. Read this before starting!

Section 001 & 002. Read this before starting! Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 3 for Spring Semester,

More information

Marking Scheme. Examination Paper. Module: Microprocessors (630313)

Marking Scheme. Examination Paper. Module: Microprocessors (630313) Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 12/06/2017 Section 1 Weighting 40% of

More information

8088/8086 Programming Integer Instructions and Computations

8088/8086 Programming Integer Instructions and Computations Unit3 reference 2 8088/8086 Programming Integer Instructions and Computations Introduction Up to this point we have studied the software architecture of the 8088 and 8086 microprocessors, their instruction

More information

Internal architecture of 8086

Internal architecture of 8086 Case Study: Intel Processors Internal architecture of 8086 Slide 1 Case Study: Intel Processors FEATURES OF 8086 It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 220 memory locations (1

More information

BAHAR DÖNEMİ MİKROİŞLEMCİLER LAB4 FÖYÜ

BAHAR DÖNEMİ MİKROİŞLEMCİLER LAB4 FÖYÜ LAB4 RELATED INSTRUCTIONS: Compare, division and jump instructions CMP REG, memory memory, REG REG, REG memory, immediate REG, immediate operand1 - operand2 Result is not stored anywhere, flags are set

More information

A Presentation created By Ramesh.K Press Ctrl+l for full screen view

A Presentation created By Ramesh.K Press Ctrl+l for full screen view Press Ctrl+l for full screen view A Presentation created By Ramesh.K rameshpkd@gmail.com Press Ctrl+l for full screen view A Microprocessor sor is a multipurpose, programmable logic device that reads binary

More information

EC-333 Microprocessor and Interfacing Techniques

EC-333 Microprocessor and Interfacing Techniques EC-333 Microprocessor and Interfacing Techniques Lecture 3 The Microprocessor and its Architecture Dr Hashim Ali Fall - 2018 Department of Computer Science and Engineering HITEC University Taxila Slides

More information

Computer Architecture 1 ح 303

Computer Architecture 1 ح 303 Lecture 4 A. Addressing MODES 1. Introduction to assembly language programming: Program is a sequence of commands used to tell a microcomputer what to do. Each command in a program is an instruction Programs

More information

Basic Intel x86 Assembly Language Programming

Basic Intel x86 Assembly Language Programming 1 Basic Intel x86 Programming 2 Intel x86 Processor Family Processor Integer Width (bits) Physical Address (bits) Year Features 8086 16 20 1978 16-bit data I/O bus 8088 16 20 1979 8-bit data I/O bus Used

More information

The x86 Architecture

The x86 Architecture The x86 Architecture Lecture 24 Intel Manual, Vol. 1, Chapter 3 Robb T. Koether Hampden-Sydney College Fri, Mar 20, 2015 Robb T. Koether (Hampden-Sydney College) The x86 Architecture Fri, Mar 20, 2015

More information

Chapter Three Addressing Mode MOV AX, BX

Chapter Three Addressing Mode MOV AX, BX Chapter Three The 8086 The 8086 When the 8086 executes an instruction, it performs the specified function on data. The data are called its operands and may be part of the instruction reside in one of the

More information

SOEN228, Winter Revision 1.2 Date: October 25,

SOEN228, Winter Revision 1.2 Date: October 25, SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003 1 Contents Flags Mnemonics Basic I/O Exercises Overview of sample programs 2 Flag Register The flag register stores the condition flags that retain

More information

IFE: Course in Low Level Programing. Lecture 6

IFE: Course in Low Level Programing. Lecture 6 IFE: Course in Low Level Programing Lecture 6 Instruction Set of Intel x86 Microprocessors Conditional jumps Jcc jump on condition cc, JMP jump always, CALL call a procedure, RET return from procedure,

More information

Midterm Exam #2 Answer Key

Midterm Exam #2 Answer Key Midterm Exam #2 Answer Key Name: Student ID #: I have read and understand Washington State University s policy on academic dishonesty and cheating YOU Signed: Problem 1) Consider the following fragment

More information

Lecture 16: Passing Parameters on the Stack. Push Examples. Pop Examples. CALL and RET

Lecture 16: Passing Parameters on the Stack. Push Examples. Pop Examples. CALL and RET Lecture 1: Passing Parameters on the Stack Push Examples Quick Stack Review Passing Parameters on the Stack Binary/ASCII conversion ;assume SP = 0202 mov ax, 124h push ax push 0af8h push 0eeeh EE 0E F8

More information

TUTORIAL. Emulador Emu8086 do. Microprocessador 8086

TUTORIAL. Emulador Emu8086 do. Microprocessador 8086 1 TUTORIAL Emulador Emu8086 do Microprocessador 8086 2 8086 Assembler Tutorial for Beginners (Part 1) This tutorial is intended for those who are not familiar with assembler at all, or have a very distant

More information

Northern India Engineering College, Delhi (GGSIP University) PAPER I

Northern India Engineering College, Delhi (GGSIP University) PAPER I PAPER I Q1.Explain IVT? ANS. interrupt vector table is a memory space for storing starting addresses of all the interrupt service routine. It stores CS:IP PAIR corresponding to each ISR. An interrupt vector

More information

Assembly Language Programming Memory Architecture

Assembly Language Programming Memory Architecture 1 Assembly Language in 8086 Memory Architecture 2 Short Overview 3 Assembly Language Programs 1 Assembly language program List of 8086 instructions + data CPU executes one by one instructions in order

More information

Segmentation in Assembly Language Programming

Segmentation in Assembly Language Programming 1 2 Segmentation in General Segmentation in Assembly Language Programming UNIX programs have 3 segments Text segment Executable machine instructions Data segment Initialized data BSS segment (Block Started

More information

CS499. Intel Architecture

CS499. Intel Architecture CS499 Intel Architecture Intel Architecture References IA-32 Intel Architecture Software Developer s Manual, Volume 1: Basic Architecture Volume 2: Instruction Set Reference www.intel.com/design/pentiumii/manuals/

More information

Project 1: Bootloader. COS 318 Fall 2015

Project 1: Bootloader. COS 318 Fall 2015 Project 1: Bootloader COS 318 Fall 2015 Project 1: Schedule Design Review - Monday, 9/28-10- min Ime slots from 1:30pm- 6:20pm - Write funcions print_char and print_string! - Answer the quesions: ü How

More information

Experiment 3 3 Basic Input Output

Experiment 3 3 Basic Input Output Experiment 3 3 Basic Input Output Introduction The aim of this experiment is to introduce the use of input/output through the DOS interrupt. Objectives: INT Instruction Keyboard access using DOS function

More information

Section 002. Read this before starting!

Section 002. Read this before starting! Points missed: Student's Name: _ Total score: /100 points East Tennessee State University -- Department of Computer and Information Sciences CSCI 2150 Computer Organization Final Exam for Fall Semester,

More information

Lecture 9. INC and DEC. INC/DEC Examples ADD. Arithmetic Operations Overflow Multiply and Divide

Lecture 9. INC and DEC. INC/DEC Examples ADD. Arithmetic Operations Overflow Multiply and Divide Lecture 9 INC and DEC Arithmetic Operations Overflow Multiply and Divide INC adds one to a single operand DEC decrements one from a single operand INC destination DEC destination where destination can

More information

8086 Micro-Processors and Assembly Programming Forth Stage المعالجات الميكروية والبرمجة بلغة التجميع استاذة الماده: م.د ستار حبيب منعثر الخفاجي

8086 Micro-Processors and Assembly Programming Forth Stage المعالجات الميكروية والبرمجة بلغة التجميع استاذة الماده: م.د ستار حبيب منعثر الخفاجي جامعة ذي قار كلية الهندسة قسم الهندسة الكهربائية وااللكترونية 8086 Micro-Processors and Assembly Programming Forth Stage المعالجات الميكروية والبرمجة بلغة التجميع استاذة الماده: م.د ستار حبيب منعثر الخفاجي

More information